home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / DVIM72-Mac 1.9.6 / source / ALLDONE.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-14  |  1.0 KB  |  40 lines  |  [TEXT/R*ch]

  1. /* -*-C-*- alldone.h */
  2. /*-->alldone*/
  3. /**********************************************************************/
  4. /****************************** alldone  ******************************/
  5. /**********************************************************************/
  6. #include "dvihead.h"
  7. #include "commands.h"
  8. #include "gendefs.h"
  9. #include "gblprocs.h"
  10. #include "egblvars.h"
  11. #include "m72.h"
  12. #include "sillymalloc.h"
  13.  
  14. void    TD_close_log( void );
  15.  
  16. void
  17. alldone()
  18.  
  19. {
  20.     /*******************************************************************
  21.     This routine  is called  on both  success and  failure to  terminate
  22.     execution.  All open files (except stdin, stdout, stderr) are closed
  23.     before calling EXIT() to quit.
  24.     *******************************************************************/
  25.  
  26.     UNSIGN16 k;
  27.  
  28.     for (k = 0; k < (UNSIGN16)nopen; ++k)
  29.     if (font_files[k].font_id != (FILE*)NULL)
  30.         (void)fclose(font_files[k].font_id);
  31.  
  32.     if (dvifp != (FILE*)NULL)
  33.         (void)fclose(dvifp);
  34.  
  35.     sillyfree();
  36.     TD_close_log();
  37.  
  38.     ExitToShell();
  39. }
  40.